namespace Jumpton.SFA.Server.Entity {
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Jumpton.Persistent;
    using System.Data;
    using System.Runtime.Serialization;
    
    
    [System.SerializableAttribute()]
    [Map("CUSTOMERS")]
    public class CUSTOMERS : ObjectRow {
        
        public CUSTOMERS() {
        }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public CUSTOMERS(System.Data.DataRow dataRow, ObjectTable parent) : 
                base(dataRow, parent) {
        }
        
        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected CUSTOMERS(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
        }
        
        [Key("ID")]
        public decimal ID {
            get {
                return (System.Decimal)GetValue("ID");
            }
            set {
                SetValue("ID", value);
            }
        }
        
        [Field("CODE")]
        public string CODE {
            get {
                return (System.String)GetValue("CODE");
            }
            set {
                SetValue("CODE", value);
            }
        }
        
        [Field("NAME")]
        public string NAME {
            get {
                return (System.String)GetValue("NAME");
            }
            set {
                SetValue("NAME", value);
            }
        }
        
        [Field("NAME2")]
        public string NAME2 {
            get {
                return (System.String)GetValue("NAME2");
            }
            set {
                SetValue("NAME2", value);
            }
        }
        
        [Field("CHAIN_CODE")]
        public string CHAINCODE {
            get {
                return (System.String)GetValue("CHAINCODE");
            }
            set {
                SetValue("CHAINCODE", value);
            }
        }
        
        [Field("BANNER_CODE")]
        public string BANNERCODE {
            get {
                return (System.String)GetValue("BANNERCODE");
            }
            set {
                SetValue("BANNERCODE", value);
            }
        }
        
        [Field("IDENTITY1")]
        public double IDENTITY1
        {
            get {
                return null == GetValue("IDENTITY1") ? 0 : (double)GetValue("IDENTITY1");
            }
            set {
                SetValue("IDENTITY1", value);
            }
        }
        
        [Field("IDENTITY2")]
        public double IDENTITY2
        {
            get {
                return null == GetValue("IDENTITY2") ? 0 : (double)GetValue("IDENTITY2");
            }
            set {
                SetValue("IDENTITY2", value);
            }
        }
        
        [Field("PARENT_CODE")]
        public string PARENTCODE {
            get {
                return (System.String)GetValue("PARENTCODE");
            }
            set {
                SetValue("PARENTCODE", value);
            }
        }

        [Field("ACTIVE")]
        public Boolean ACTIVE {
            get {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set {
                SetValue("ACTIVE", value);
            }
        }
        
        [Field("STATUS")]
        public string STATUS {
            get {
                return (System.String)GetValue("STATUS");
            }
            set {
                SetValue("STATUS", value);
            }
        }
        
        [Field("CUST_CLASS_CODE")]
        public string CUSTCLASSCODE {
            get {
                return (System.String)GetValue("CUSTCLASSCODE");
            }
            set {
                SetValue("CUSTCLASSCODE", value);
            }
        }
        
        [Field("GEO_LEVEL_CODE")]
        public string GEOLEVELCODE {
            get {
                return (System.String)GetValue("GEOLEVELCODE");
            }
            set {
                SetValue("GEOLEVELCODE", value);
            }
        }
        
        [Field("LOCAL_LEVEL1_CODE")]
        public string LOCALLEVEL1CODE {
            get {
                return (System.String)GetValue("LOCALLEVEL1CODE");
            }
            set {
                SetValue("LOCALLEVEL1CODE", value);
            }
        }
        
        [Field("LOCAL_LEVEL2_CODE")]
        public string LOCALLEVEL2CODE {
            get {
                return (System.String)GetValue("LOCALLEVEL2CODE");
            }
            set {
                SetValue("LOCALLEVEL2CODE", value);
            }
        }
        
        [Field("CONTACT_TIME_ID")]
        public decimal CONTACTTIMEID {
            get {
                return (System.Decimal)GetValue("CONTACTTIMEID");
            }
            set {
                SetValue("CONTACTTIMEID", value);
            }
        }
        
        [Field("DEFAULT_UOM_CODE")]
        public string DEFAULTUOMCODE {
            get {
                return (System.String)GetValue("DEFAULTUOMCODE");
            }
            set {
                SetValue("DEFAULTUOMCODE", value);
            }
        }
        
        [Field("DOC_FOOTER")]
        public string DOCFOOTER {
            get {
                return (System.String)GetValue("DOCFOOTER");
            }
            set {
                SetValue("DOCFOOTER", value);
            }
        }
        
        [Field("ADDITIONAL_INFO")]
        public string ADDITIONALINFO {
            get {
                return (System.String)GetValue("ADDITIONALINFO");
            }
            set {
                SetValue("ADDITIONALINFO", value);
            }
        }
        
        [Field("CUSTOMER_PRODUCT_LIST_ID")]
        public decimal CUSTOMERPRODUCTLISTID {
            get {
                return (System.Decimal)GetValue("CUSTOMERPRODUCTLISTID");
            }
            set {
                SetValue("CUSTOMERPRODUCTLISTID", value);
            }
        }
        
        [Field("DESTINY_DISTRIBUTION_AREA")]
        public string DESTINYDISTRIBUTIONAREA {
            get {
                return (System.String)GetValue("DESTINYDISTRIBUTIONAREA");
            }
            set {
                SetValue("DESTINYDISTRIBUTIONAREA", value);
            }
        }
        
        [Field("MEASURE_PROFILE_ID")]
        public decimal MEASUREPROFILEID {
            get {
                return (System.Decimal)GetValue("MEASUREPROFILEID");
            }
            set {
                SetValue("MEASUREPROFILEID", value);
            }
        }
        
        [Field("DOMAIN_ID")]
        public decimal DOMAINID {
            get {
                return (System.Decimal)GetValue("DOMAINID");
            }
            set {
                SetValue("DOMAINID", value);
            }
        }

        [Field("LAST_UPDATER")]
        public string LAST_UPDATE
        {
            get {
                return (System.String)GetValue("LAST_UPDATE");
            }
            set {
                SetValue("LAST_UPDATE", value);
            }
        }
        
        [Field("LAST_UPDATE_TIME")]
        public decimal LAST_UPDATE_TIME
        {
            get {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }
        
        [Field("BLACKLISTED")]
        public string BLACKLISTED {
            get {
                return (System.String)GetValue("BLACKLISTED");
            }
            set {
                SetValue("BLACKLISTED", value);
            }
        }
        
        [Field("SHIPFROMLOCATIONCODE")]
        public string SHIPFROMLOCATIONCODE {
            get {
                return (System.String)GetValue("SHIPFROMLOCATIONCODE");
            }
            set {
                SetValue("SHIPFROMLOCATIONCODE", value);
            }
        }
        
        [Field("BRACKET_ID")]
        public decimal BRACKETID {
            get {
                return (System.Decimal)GetValue("BRACKETID");
            }
            set {
                SetValue("BRACKETID", value);
            }
        }
        
        [Field("ICO_PROFILE_ID")]
        public decimal ICOPROFILEID {
            get {
                return (System.Decimal)GetValue("ICOPROFILEID");
            }
            set {
                SetValue("ICOPROFILEID", value);
            }
        }
        
        [Field("INITIATIVE_PROFILE_ID")]
        public decimal INITIATIVEPROFILEID {
            get {
                return (System.Decimal)GetValue("INITIATIVEPROFILEID");
            }
            set {
                SetValue("INITIATIVEPROFILEID", value);
            }
        }
        
        [Field("DEFAULT_SHIP_TO_CODE")]
        public string DEFAULTSHIPTOCODE {
            get {
                return (System.String)GetValue("DEFAULTSHIPTOCODE");
            }
            set {
                SetValue("DEFAULTSHIPTOCODE", value);
            }
        }
        
        [Field("ORG_ID")]
        public int ORGID {
            get {
                return (System.Int32)GetValue("ORGID");
            }
            set {
                SetValue("ORGID", value);
            }
        }

     

        [Field("CREATE_USER")]
        public string CREATE_USER
        {
            get
            {
                return (System.String)GetValue("CREATE_USER");
            }
            set
            {
                SetValue("CREATE_USER", value);
            }
        }

        [CalculateField]
        public DateTime? CreateDate
        {
            get
            {
                DateTime? create = null;
                try
                {
                    long time = (long)GetValue("CREATE_TIME");
                    create = DateTime.ParseExact(GetValue("CREATE_TIME").ToString(), "yyyyMmddhhmmss", System.Globalization.CultureInfo.CurrentCulture
                        , System.Globalization.DateTimeStyles.None);
                }
                catch
                {

                }
                return create;
            }
            
        }

        [Field("CREATE_TIME")]
        public Decimal CREATE_TIME
        {
            get {
                return (System.Decimal)GetValue("CREATE_TIME");
            }
            set {
                SetValue("CREATE_TIME", value);
            }
        }
    }
}
